package com.igeek.compus.study.product.entity;

import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class Product {
    private Integer id;

    private Integer sellerId;

    private String productName;

    private String description;

    private String nickName;

    private BigDecimal price;

    private Date createTime;

    //0-上架中 1-已下架 2-已出售 -1-删除
    private Integer status;

    private Integer page;// 前端传多少页
    private Integer limit;// 每页展示多少条数据
    private Integer pageIndex;

    public Integer getPageIndex() {
        if(page != null && limit != null) {
            return (page - 1) * limit;
        }
        return pageIndex;
    }
}
